package coupon

import (
	"crmeb-common/global"
	"time"
)

// Coupon 优惠券表
type Coupon struct {
	global.BaseModel
	MerId int32 `json:"merId" gorm:"column=mer_id;comment:商户ID"`

	Name string `json:"name" gorm:"column=name;comment:优惠券名称"`

	Publisher int32 `json:"publisher" gorm:"column=publisher;comment:发行方，1-平台，2-商户"`

	Category int32 `json:"category" gorm:"column=category;comment:类别 1-商家券, 2-商品券, 3-通用券，4-品类券，5-品牌券，6-跨店券"`

	ReceiveType int32 `json:"receiveType" gorm:"column=receive_type;comment:领取类型 1-手动领取,2-商品赠送券,3-平台活动发放"`

	CouponType int32 `json:"couponType" gorm:"column=coupon_type;comment:优惠券类型 1-满减券,2-折扣券"`

	Money int64 `json:"money" gorm:"column=money;comment:优惠金额"`

	Discount int32 `json:"discount" gorm:"column=discount;comment:折扣"`

	MinPrice int64 `json:"minPrice" gorm:"column=min_price;comment:最低消费，0代表不限制"`

	IsLimited bool `json:"isLimited" gorm:"column=is_limited;comment:是否限量, 默认0 不限量， 1限量"`

	Total int32 `json:"total" gorm:"column=total;comment:发放总数"`

	LastTotal int32 `json:"lastTotal" gorm:"column=last_total;comment:剩余数量"`

	IsTimeReceive bool `json:"isTimeReceive" gorm:"column=is_time_receive;comment:领取是否限时, 默认0-不限时，1-限时"`

	ReceiveStartTime time.Time `json:"receiveStartTime" gorm:"column=receive_start_time;comment:可领取开始时间"`

	ReceiveEndTime time.Time `json:"receiveEndTime" gorm:"column=receive_end_time;comment:可领取结束时间"`

	IsFixedTime bool `json:"isFixedTime" gorm:"column=is_fixed_time;comment:是否固定使用时间, 默认0-否，1-使用固定时间"`

	UseStartTime time.Time `json:"useStartTime" gorm:"column=use_start_time;comment:可使用时间范围 开始时间"`

	UseEndTime time.Time `json:"useEndTime" gorm:"column=use_end_time;comment:可使用时间范围 结束时间"`

	Day int32 `json:"day" gorm:"column=day;comment:天数"`

	Sort int32 `json:"sort" gorm:"column=sort;comment:排序"`

	Status bool `json:"status" gorm:"column=status;comment:状态（0：关闭，1：开启）"`

	LinkedData string `json:"linkedData" gorm:"column=linked_data;comment:关联数据"`

	IsRepeated bool `json:"isRepeated" gorm:"column=is_repeated;comment:是否可重复领取"`
}
